<template>
  <div class="config-group">
    <h4>尺寸与位置</h4>
    <div class="config-item">
      <label>宽度:</label>
      <input
        type="text"
        v-model="style.width"
        @input="updateStyle"
        placeholder="例如: 200px"
      >
    </div>
    <div class="config-item">
      <label>高度:</label>
      <input
        type="text"
        v-model="style.height"
        @input="updateStyle"
        placeholder="例如: 100px"
      >
    </div>
    <div class="config-item">
      <label>左边距:</label>
      <input
        type="text"
        v-model="style.left"
        @input="updateStyle"
        placeholder="例如: 0px"
      >
    </div>
    <div class="config-item">
      <label>上边距:</label>
      <input
        type="text"
        v-model="style.top"
        @input="updateStyle"
        placeholder="例如: 0px"
      >
    </div>
  </div>
</template>

<script>
export default {
  name: 'BaseStyleConfig',
  props: {
    style: {
      type: Object,
      required: true
    }
  },
  methods: {
    updateStyle() {
      this.$emit('update:style', { ...this.style })
    }
  }
}
</script>

<style scoped>
.config-group {
  margin-bottom: 20px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

.config-group h4 {
  margin: 0 0 10px 0;
  color: #666;
}

.config-item {
  margin: 10px 0;
  display: flex;
  align-items: center;
}

.config-item label {
  width: 80px;
  color: #666;
}

.config-item input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
</style> 